<%@page import="com.winexpress.util.SessionAttributes"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>wineXpress online shop</title>
     
    </head>
    <body>
        <t:customerNavigation/>

        <div class="header">
            <div class="logo_img"><img alt="Site Name" src="/WineXpressClient/resources/images/logo.png"></div>
        </div>

        <div class="panel panel-default" style="width:70%; margin-left: 15%; margin-top: 10px" >
            <div class="panel-heading">
                <% Boolean isAdmin = (Boolean) session.getAttribute(SessionAttributes.IS_ADMIN);
                    Boolean passwordUpdateSuccess = (Boolean) session.getAttribute(SessionAttributes.PASSWORD_UPDATE_SUCCESS);
                    if (isAdmin != null && isAdmin) { %>
                <h3 class="panel-title">Staff Sign in</h3>
                <% } else { %>
                <h3 class="panel-title">Customer Sign in</h3>
                <% }%>
            </div>
            <div class="panel-body">
                <%if (isAdmin != null && isAdmin) { %>
                <form class="form-horizontal" role="form" action="/WineXpressClient/login/adminHome"  method="POST">
                    <% } else { %>
                    <form class="form-horizontal" role="form" action="/WineXpressClient/login/index"  method="POST">
                        <% }%>
                        <% if (passwordUpdateSuccess != null && passwordUpdateSuccess) { %>
                        <div class="alert alert-success">Your password is updated successfully, please login</div>
                        <% } else { %>
                        <div class="alert alert-danger">Fail to update your password, please login again</div>
                        <% }%>
                        <div class="form-group">
                            <label for="inputEmail" class="col-sm-2 control-label">Email</label>
                            <div class="col-sm-10">
                                <input type="email" class="form-control" name="inputEmail" placeholder="Email">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword" class="col-sm-2 control-label">Password</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" name="inputPassword" placeholder="Password">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default">Sign in</button>
                            </div>
                    </form>
            </div>
        </div>
    </div>
</body>
</html>
